Part Number Hot Search : 
MIC2194 MC101 DRD3C F1077 MNADJR MC74VHC1 HSBD136 MCP451X
Product Description
Full Text Search
 

To Download AN144 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  rev. 2.0 10/10 copyright ? 2010 by silicon laboratories AN144 AN144 cp210 x /cp211 x d evice c ustomization g uide relevant devices ? this application note applies to the following devices: ? cp2101, cp2102, cp2103, cp2104, cp2105, cp2110, cp2112 1. introduction this document is intended for developers creating pro ducts based on the cp210x/cp211x usb bridge controllers. it provides information about obtaining a vendor id (vid ) and product id (pid) for a cp210x/cp211x product and describes the steps necessary for customizing the de vice descriptors contained in the cp210x/cp211x programmable area. refer to www.silabs.com for the latest revisions of this document and other application notes related to the cp210x/cp211x device families. 2. obtaining a vid and pid each device on a usb bus must have a unique vid, pid, and serial number combination. vendor ids are owned by the vendor company and assigned by the usb implementers forum (usb-if) only. details about obtaining a unique vid can be found at www.usb.org/developers/vendor . to obtain the right to license the usb-if logo, you must register your product's vid and pid with usb-if and submit your product to the usb-if compliance program. usb-if compliance program details are available at www.usb.org/developers/compliance . once your product is certified, you ca n add it to the usb-if integrators list, and you can also use the ?certified usb? logo on your product. if you do not wish to license the usb-if logo for your product, you can use the defa ult silicon laboratories vid along with a unique pid. to obtain a unique pi d for your cp210x/cp211x-based product, visit ? http://www.silabs.com/requestpid . having a unique pid reduces the chances that another device with the same vid, pid, and serial number w ill appear on the same usb bus. 3. customizing driver installati ons, cp210x custom setup utility ? (cp2101/2/3/4/5) the driver installation is customizable by modifying certain sections of the ha rdware installation files (.inf). the strings contained in the .inf files affe ct what is displayed in the ?found new hardware wizard ? dialogs, device manager, and the registry. refer to ?an220: u sb driver customizatio n? for more details. note: any changes to the windows ? installation .inf files will require new windows hardware quality labs (whql) tests.
AN144 2 rev. 2.0 4. customizing device descriptor s and other configurable options the descriptors and other configurable options of the devi ces in the cp210x/cp211x families are modifiable using the following windows programs. these programs are included in the software zip file in this application note. how to use these programs is described in more detail in the following sections. cp210xsetids uses the windows host ap i functions implemented by cp210xmanufacturing.dll . the host api functions give read/write access to the descriptors contained in progra mmable areas of a connected device. another option is implementing a custom application using the host api and cp210xmanufacturing.dll suited to the individual needs of a particular production environment. both cp2110setids and cp2112setids use the slabhiddevice.dll and the customization interface specified in their respective application notes, ?an433: cp2110 hi d to uart api specification? and ?an496: cp2112 hid usb to smbus api specification?. the descriptors can also be set in the factory at production time for large orders. contact your silicon laboratories sales representative for details. table 1. device customization programs device program cp2101/2/3/4/5 cp210xsetids.exe cp2110 cp2110setids.exe cp2112 cp2112setids.exe
AN144 rev. 2.0 3 4.1. customizing device descriptors using cp210xsetids.exe (cp2101/2/3/4/5) cp210xsetids.exe is an example program that uses the cp 210x host api functi ons implemented by cp210xmanufacturing.dll . the program window is shown in figure 1 . cp210xsetids.exe demonstrates the method of accessing and changing the descriptors cont ained in the connected device's programmable area. to use cp210xsetids.exe , it is necessary to have the devices connected and have the unmodified device drivers that shipped with the original cp210x kit inst alled. the customized devi ce driver installation files that contain the vid and pid values should also be installed. for informati on on creating customized dev ice drivers for the cp210x, refer to ?an220: usb driver customizat ion.? the default driver must be insta lled so that the cp210x device with the default factory settings appears in the device list. the customized driver s will be needed after the device ids have been changed and the cp210x device is reset. all cp210x devices are programmed in the same manner using the cp210xsetids.exe tool, but each parameter on the one-time-programmable (otp ) devices can only be programmed one time. the cp2101, cp2102, and cp2103 parameters can be reprogramm ed multiple times using the cp210xse tids.exe utility, but the cp2104 and cp2105 parameters can only be programmed once using the cp210xsetids.exe utilit y. after the cp2104 and cp2105 have been pr ogrammed once, the cp210xsetids.exe utility c an be run, but the ne w values will not be programmed into the device. before running cp210xsetids.exe , copy cp210xmanufacturing.dll into the \windows, \winnt, or \system32 directory, the directory containing the executable, or any directory in the ?path? environment variable. figure 1. cp210xsetids example application
AN144 4 rev. 2.0 when cp210xsetids.exe is launched, the program searches the windows registry for any cp210x devices attached to the pc. the full path information for all of th e devices found is inserted into the ?select device? drop- down list, and the first devic e is selected automatically. cp210xsetids.exe then queries information from the selected device using the cp210x host api functions and fills in the values for each of the seven selectable fields of the application. when a new device is selected from the list, the fields will be updated with in formation from the most recently selected device. to change one or more of the values, click on the checkbox to the left of the field and enter the new value. once the new values have been entered, click on the ?program device? button. the values entered are subject to the following limitations: 1. vid ?four hexadecimal digits. 2. pid ?four hexadecimal digits. 3. max. power ?two hexadecimal digits with maximum setting of 250 (the value is in 2 ma units). 4. serial number ?any sequence of up to 63 characters (c p2101/2/3/4) or 16 characters (cp2105). 5. product string ?any sequence of up to 126 characters (c p2101/2/3/4) or 47 characters (cp2105). 6. release version ?each field is a decimal number value 0?99. 7. flush buffers ?selects which buffers to empty upon the open and close events. applies to cp2104/5 devices only. 8. interface 0 and 1 strings ?any sequence of up to 32 characters. applies to cp2105 only. 9. device mode ?selects the operating mode for the enhanced a nd standard interfaces. applies to cp2105 only. notes: 1. avoid connecting more than one device containing the same vid, pid, and serial number combination. 2. when the serial number of a cp210x device is changed and the device is reset by calling the host api function cp210x_reset() , the device will reenumerate, and t he device driver will be installed. 3. the serial number and product string are automatica lly converted to unicode strings before programming.
AN144 rev. 2.0 5 4.2. customizing d evice descriptors using cp2110setids.exe (cp2110) cp2110setids.exe is an example program that uses th e cp2110 api functions implemented by slabhidtouart.dll . the program window is shown in figure 2 . cp2110setids.exe demonstrates the method of accessing and changing the descriptors containe d in the connected devi ce's programmable area. the various customizable fields of the cp2110 devices are only programmable one time using the program. after the fields are programmed once, cp2110setids can access the fields, but it is not able to reprogram them. figure 2. cp2110setids application when cp2110setids.exe is launched, the program searches for any cp2110 devices attached to the pc. the full path information for all of the devices found is inserted in to the "device path" drop-down list, and the first device is selected automatically. the application then queries info rmation from the selected devi ce using the api functions and fills in the values for each of the selectable fields of the application. when a new device is selected from the list, the fields are updated with informati on from the most recently selected device. to change one or more of the values, click on the checkbox to the left of the field and enter the new value. once the new values are entered, click on the "program device" button. once a field is programmed, the checkbox is no longer selectable, indicating that the field is locked from further programming.
AN144 6 rev. 2.0 the values entered are subject to the following limitations: 1. vid ?2-byte value in hexadecimal. 2. pid ?2-byte value hexadecimal. 3. max. power ?1-byte value in hexadecimal digits with maximum se tting of 0xfa (the value is in 2 ma units). 4. release version ?each field is a decimal number value 0-255. 5. manufacturer string ?any sequence of up to 30 ascii characters 6. product string ?any sequence of up to 30 ascii characters. 7. serial number ?any sequence of up to 30 ascii characters. if the ?prevent further programming? checkbox is selected , all customizable fields of the cp2110 are permanently locked and are no longer customizable. see ?an434: cp2110 interface specification? for a full description of each of the customizable parameters. if you are using the cp2110setids to program multiple device s, you can save the customiz ed values to a text file using the file ? save and file ? save as commands. when connecting a new device, use the file ? open command to retrieve the saved settings, which are then directly programmable to the new device. notes: 1. avoid connecting more than one device containing the same vid, pid, and serial number combination. 2. gpio.0 / clk must be configured as a ?clk output - push pull? before configuring the ?c lk output divider? setting. 3. the manufacturer string, product string, and serial number are automatically converted to unicode strings before programming.
AN144 rev. 2.0 7 4.3. customizing d evice descriptors using cp2112setids.exe (cp2112) cp2112setids.exe is an example program that uses th e cp2112 api functions implemented by slabhidtouart.dll . the program window is shown in figure 3 . cp2112setids.exe demonstrates the method of accessing and changing the descriptors containe d in the connected devi ce's programmable area. the various customizable fields of the cp2112 devices are only programmable one time using the program. after the fields are programmed once, cp2112setids can access the fields, but it is not able to reprogram them. figure 3. cp2112setids application when cp2112setids.exe is launched, the program searches for any cp2112 devices attached to the pc. the full path information for all of the devices found is inserted in to the ?device path? drop-down list, and the first device is selected automatically. the application then queries info rmation from the selected devi ce using the api functions and fills in the values for each of the selectable fields of the application. when a new device is selected from the list, the fields will be updated with information from the mo st recently selected device. to change one or more of the values, click on the checkbox to the left of the field, and enter the new value. once the new values are entered, clic k on the ?program device? button.
AN144 8 rev. 2.0 the values entered are subject to the following limitations: 1. vid ?2-byte value in hexadecimal. 2. pid ?2-byte value hexadecimal. 3. max. power ?1 byte value in hexadecimal digits with ma ximum setting of 0xfa (the value is in 2 ma units). 4. release version ?each field is a decimal number value 0?255. 5. manufacturer string ?any sequence of up to 30 ascii characters 6. product string ?any sequence of up to 30 ascii characters. 7. serial number ?any sequence of up to 30 ascii characters. if the ?prevent further programming? checkbox is selected , all customizable fields of the cp2112 are permanently locked and are no long customizable. see ?an496: cp2112 hid usb-to-smbus api specification? for a full description of each of the customizable parameters. if you are using the cp2112setids to program multiple device s, the customized values can be saved to a text file using the file ? save and file ? save as commands. when connecting a new device, use the file ? open command to retrieve the saved settings, which can be directly programmed to the new device. notes: 1. avoid connecting more than one device containing the same vid, pid, and serial number combination. 2. the manufacturer string, product string, and serial number are automatically converted to unicode strings before programming. 4.4. building cp210xsetids.exe, cp2110setids.exe, or cp2112setids.exe open the corresponding project file for the program with the *.dsw extension in visual st udio 6.0. select ?release? or ?debug?, and build the project. 4.5. creating cu stom applications for cp2101/2/3/4/5 devices, custom applications can use the cp210x host api implemented in cp210xmanufacturing.dll . to use functions implemented in cp210xmanufacturing.dll , link cp210xmanufacturing.lib with your vi sual c++ 6.0 application. include cp210xmanufacturingdll.h in any file that calls functions implemented in cp210xmanufacturing.dll . see ?5. cp210x host api functions (cp2101/2/3/ 4/5)? for more information regarding the dll. for cp2110 devices, custom applications can use the cp2110 api implemented in slabhidtouart.dll . to use functions implemented in slabhidtouart.dll , link slabhidtouart.lib with your visual c++ 6.0 application. include slabcp2110.h in any file that calls functions implemented in slabhidtouart.dll . see ?an433: cp2110 hid to uart api specific ation? for more details. for cp2112 devices, custom applications can use the cp2112 api implemented in slabhidtosmbus.dll . to use functions implemented in slabhidtosmbus.dll , link slabhidtosmbus.lib with your visual c++ 6.0 application. include slabcp2112.h in any file that calls functions implemented in slabhidtosmbus.dll . see ?an496: cp2112 hid usb to smbus api specif ication? for more details.
AN144 rev. 2.0 9 5. cp210x host api func tions (cp2101/2/3/4/5) the cp210x host api is pr ovided as a means to facilitate producti on of customized cp210 x devices. the api allows access to the cp210x device for retrieving and se tting the vid, pid, product string, serial number, self- power attribute, maximum power consumption, and device version. the cp210x host api is provided in the form of a windows dynamic link library (dll), cp210xmanufacturing.dll . the host interface dll communicates wi th the bridge controller device via the provided device driver and the operating system's usb stac k. the following is a list of the available host api functions: cp210x_getnumdevices() returns the number of cp210x devices connected. cp210x_getproductstring() returns a descriptor from the registry for a cp210x usb device. cp210x_getpartnumber() returns the 1-byte part number of a cp210x device. cp210x_open() opens a cp210x device as a usb device and returns a handle. cp210x_close() closes a cp210x device handle. cp210x_setvid() sets the 2-byte vendor id of a cp210x device. cp210x_setpid() sets the 2-byte product id of a cp210x device. cp210x_setproductstring() sets the product description string of a cp210x device. cp210x_setinterfacestring() sets the interface string of a cp2105 device. cp210x_setserialnumber() sets the serial number st ring of a cp210x device. cp210x_setselfpower() sets the self-power attribute of a cp210x device. cp210x_setmaxpower() sets the maximum power consumption of a cp210x device. cp210x_setflushbufferconfig() sets the flush buffer configuration of cp2104/5 devices. cp210x_setdevicemode() sets the operating modes of both interfaces of a cp2105 device. cp210x_setdeviceversion() sets version number of the cp210x device. cp210x_setbaudrateconfig() sets the baud rate configuration data of a cp210x device. cp210x_setlockvalue() sets the 1-byte lock value of a cp210x device. cp210x_setportconfig() sets the port configuration of a cp2101/2/3/4 device. cp210x_setdualportconfig() sets the port configuration of a cp2105 device. cp210x_getdeviceproductstring() gets the product description string of a cp210x device. cp210x_getdeviceinterfacestring() gets the interface string of a cp2105 device. cp210x_getdeviceserialnumber() gets the serial number string of a cp210x device. cp210x_getdevicevid() gets the vendor id of a cp210x device. cp210x_getdevicepid() gets the product id of a cp210x device. cp210x_getselfpower() gets the self-power attribute of a cp210x device. cp210x_getmaxpower() gets the maximum power consumption value of a cp210x device. cp210x_getflushbufferconfig() gets the flush buffer configuration of cp2104/5 devices. cp210x_getdevicemode() gets the operating modes of interfaces of a cp2105 device. cp210x_getdeviceversion() gets the version number of a cp210x device. cp210x_getbaudrateconfig() gets the baud rate configuration data of a cp210x device. cp210x_getlockvalue() gets the 1-byte lock value of a cp210x device. cp210x_getportconfig() gets the port configur ation of a cp210x device. cp210x_getdualportconfig() gets the port configuration of a cp2105 device. cp210x_reset() resets a cp210x device.
AN144 10 rev. 2.0 in general, the user initiates communication with the target cp210x device by making a call to cp210x_getnumdevices() . this call returns the number of cp210x ta rget devices. this number is used as a range when calling cp210x_getproductstring() to build a list of devices connected to the host machine. a handle to the device must first be opened by a call to cp210x_open() using an index determ ined from the call to cp210x_getnumdevices() . the handle will be used for all subsequent accesses. when i/o operations are complete, the device handle is closed by a call to cp210x_close() . when programming a cp2105 device to configure the mode, the following functions must be called in the following order: cp210x_setdevicemode() cp210x_setdualportconfig() the remaining functions are provided to allow access to customizable values contained in the cp210x programmable area.
AN144 rev. 2.0 11 5.1. cp210x_getnumdevices description: this function returns the number of cp210x devices connected to the host. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getnumdevices( lpdword numdevices ) parameters: 1. numdevices?address of a dword that will contain th e number of devices. return value: cp210x_status = cp210x_success, ? cp210x_device_not_found, ? cp210x_invalid_parameter 5.2. cp210x_getproductstring description: this function returns a null-termi nated serial number (s/n) string, product description string, or full path string for the device specified by an in dex passed in the devicenum parameter. the index of the first device is 0, and th e index of the last device is th e value (numdevices) returned by cp210x_getnumdevices() - 1. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getproductstring( dword devicenum, ? lpvoid devicestring, dword options ) parameters: 1. devicenum?index of the device for which the product descripti on string, serial number, or full path is desired. 2. devicestring?variable of type cp210x_device_string returning the null-terminated serial number, device description or full path string. 3. options?flag that determines if devicestring contains the product description, serial number, or full-path string. return value: cp210x_status = cp210x_success, ? cp210x_device_not_found, ? cp210x_invalid_parameter
AN144 12 rev. 2.0 5.3. cp210x_getpartnumber description: returns the 1-byte part number contained in a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status winapi cp210x_getpartnumber(handle cyhandle, ? lpbyte lpbpartnum); parameters: 1. handle?handle to the device returning a part number. 2. partnum?pointer to a 1-byte value returning the part number of the device. ? a cp210x_cp2101_device denotes a cp2101 device, and a cp210x_cp2102_device denotes a cp2102 device. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.4. cp210x_open description: opens and returns a handle to a device using a device number determined by the number returned from cp210x_getnumdevices() . supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_open( dword devicenum, handle* handle ) parameters: 1. devicenum?device index. 0 for the first device, 1 for the second, etc. 2. handle?pointer to a variable where the handle to the device will be stored. this handle will be used for all subsequent accesses to the device. return value: cp210x_status = cp210x_success, ? cp210x_device_not_found, ? cp210x_invalid_parameter 5.5. cp210x_close description: closes an open device handle. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_close( handle handle ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle
AN144 rev. 2.0 13 5.6. cp210x_setvid description: sets the 2-byte vendor id field of th e device descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setvid( handle handle, word vid ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. vid?2-byte vendor id value. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.7. cp210x_setpid description: sets the 2-byte product id field of th e device descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setpid( handle handle, word pid ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. pid?2-byte product id value. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 14 rev. 2.0 5.8. cp210x_setproductstring description: sets the product description string of the string de scriptor of a cp210x devic e. if the string is not already in unicode format, the function will convert t he string to unicode befo re committing it to programmable memory. the character size limit (i n characters, not bytes), not including a null terminator, is cp210x_max_product_strlen or cp2105_max_product_strlen . supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setproductstring( handle handle, lpvoid product, ? byte length, bool converttounicode=true ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. product?buffer containing the product string value. 3. length?length of the string in characters (n ot bytes), not including a null terminator. 4. converttounicode?boolean flag that tells the function if the string needs to be converted to unicode. the flag is set to true by default (i.e ., the string is in ascii format and needs to be converted to unicode). return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.9. cp210x_setinterfacestring description: sets the interface string for the one of the two in terfaces available on the cp2105. if the string is not already in unicode fo rmat, the function will convert the string to unicode befor e committing it to programmable memory. the character size limit (i n characters, not bytes), not including a null terminator, is cp2105_max_interface_strlen . supported devices: cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setinterfacestring( handle handle, byte interface- number, lpvoid interface, byte length, bool converttounicode) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. interfacenumber?set to 0 for enhanced interface string, or 1 for standard interface string. 3. interface?buffer containing the interface string. 4. length?length of the string in characters (n ot bytes), not including a null terminator. 5. converttounicode?boolean flag that tells the function if the string needs to be converted to unicode. the flag is set to true by default (i.e ., the string is in ascii format and needs to be converted to unicode). return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 rev. 2.0 15 5.10. cp210x_setserialnumber description: sets the serial number string of the string descri ptor of a cp210x device . if the string is not already in unicode format, the function will convert t he string to unicode befo re committing it to programmable memory. the character size limit (i n characters, not bytes), not including a null terminator, is cp210x_max_serial_strlen . supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setserialnumber( handle handle, ? lpvoid serialnumber, byte length, bool converttounicode=true ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. serialnumber?buffer containing the serial number string value. 3. length?length in characters (not bytes), not including a null terminator. 4. converttounicode?boolean flag that tells the function if the string needs to be converted to unicode. the flag is set to true by default, i.e. the string is in ascii format and needs to be converted to unicode. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.11. cp210x_setselfpower description: sets or clears the self-powered bit of the power a ttributes field of the configuration descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setselfpower( handle handle, bool selfpower ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. selfpower?boolean flag where true means set the self-powered bit, and false means clear the self-powered bit. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 16 rev. 2.0 5.12. cp210x_setmaxpower description: sets the max power field of the configur ation descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setmaxpower( handle handle, byte maxpower ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. maxpower?1-byte value representing the maxi mum power consumption of the cp210x usb device, expressed in 2 ma units. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.13. cp210x_setflushbufferconfig description: sets the flush buffer config uration of a cp210x device. supported devices: cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setmaxpower( handle handle, ? byte flushbufferconfig ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. flushbufferconfig?set to determine which buffer(s) to flush (tx and/or rx) and upon which event (open and/or close). see the header file for the bit defintions for this byte value. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_function_not_supported ? cp210x_device_not_found ?
AN144 rev. 2.0 17 5.14. cp210x_setdevicemode description: sets the operating mode (gpio or modem) or each interface of a cp210x device. supported devices: cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setmaxpower( handle handle, ? byte devicemodeeci, byte devicemodesci) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. devicemodeeci?set to 0 for modem mode for e nhanced interface. set to 1 for gpio mode. 3. devicemodesci?set to 0 for modem mode for e nhanced interface. set to 1 for gpio mode. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_not_found ? cp210x_function_not_supported 5.15. cp210x_setdeviceversion description: sets the device release version field of the device descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setdeviceversion( handle handle, word version ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. version?2-byte device release version number in binary-coded decimal (bcd) format with the upper two nibbles containing the two decimal digits of the major version and the lower two nibbles containing the two decimal digits of the minor version. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 18 rev. 2.0 5.16. cp210x_setbaudrateconfig description: sets the baud rate configurat ion data of a cp210x device. supported devices: cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status winapi cp210x_setbaudrateconfig(handle cyhandle, baud_config* baudconfigdata); parameters: 1. handle?handle to the device from which to get the part number. 2. baudconfigdata?pointer to a baud_config structure containing the baud config data to be set on the device. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.17. cp210x_setlockvalue description: sets the 1-byte lock value of a cp210x device. supported devices: cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status winapi cp210x_setlockvalue(handle cyhandle); parameters: 1. handle?handle of the device to lock. this will permanently set the lock value to 0x01. ? ? warning: setting the lock value locks all customizable data and cannot be reset; only use this function to keep all customizable data on the part permanently. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 rev. 2.0 19 5.18. cp210xsetportconfig description: sets the current port pin configuration from the cp210x device. supported devices: cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setportconfig(handle handle, lpvoid portconfig) parameters: 1. handle?handle to the device as returned by cp210x_open() 2. portconfig?pointer to a port_config structure return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed, ? cp210x_unsupported_device 5.19. cp210xsetdualportconfig description: sets the current port pin configuration from th e cp210x device. setdevicemode() must be called before calling this function. supported devices: cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setportconfig(handle handle, lpvoid dualportcon- fig) parameters: 1. handle?handle to the device as returned by cp210x_open() 2. dualportconfig?pointer to a dual_port_config structure return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed, ? cp210x_unsupported_device
AN144 20 rev. 2.0 5.20. cp210x_getdeviceproductstring description: returns the product description string of the string descriptor of a cp210x device. if the convert - toascii parameter is set, the string will be converted to ascii format before being returned to the caller. the character size limit (in characters, not bytes), not including a null terminator, is cp210x_max_product_strlen . supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getdeviceproductstring( handle handle, ? lpvoid product, lpbyte length, bool converttoascii=true ) parameters: 1. handle?handle to the device to clos e as returned by cp210x_open(). 2. product?pointer to a buffer returning the product string value. 3. length?pointer to a byte value returning the length of the string in characters (not bytes), not including a null terminator. 4. converttoascii?boolean flag that tells the function whether the string needs to be converted to ascii before it is returned to the caller. the fl ag is set to true by default (i.e., the caller is expecting the string in ascii format). return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 rev. 2.0 21 5.21. cp210x_getdeviceinterfacestring description: gets the specified interface string from a cp210x device. if the converttoascii parameter is set, the string will be converted to ascii format before being re turned to the caller. the character size limit (in characters, not bytes), not including a null terminator, is cp210x_max_serial_strlen . supported devices: cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getdeviceinterfacestring( handle handle, ? byte interfacenumber, lpvoid interface, byte length, bool convertto- ascii) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. interfacenumber ?set to 0 for enhanced interface. set to 1 for standard interface. 3. interface?pointer to buffer returning the selected interface string value. 4. length?pointer to a byte value returning the length of the string in characters (not bytes), not including a null terminator. 5. converttoascii?boolean flag that tells the function whether the string needs to be converted to ascii before it is returned to the caller. the fl ag is set to true by default (i.e., the caller is expecting the string in ascii format). return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 22 rev. 2.0 5.22. cp210x_getdeviceserialnumber description: gets the serial number string of the string desc riptor of a cp210x device. if the converttoascii parameter is set, the stri ng will be converted to ascii format before bein g returned to the caller. the character size limit (in characters, not bytes), not including a null terminator, is cp210x_max_serial_strlen . supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getdeviceserialnumber( handle handle, ? lpvoid serialnumber, lpbyte length, bool converttoascii=true ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. serialnumber ?pointer to a buffer returning the serial number string value. 3. length?pointer to a byte value returning the length of the string in characters (not bytes), not including a null terminator. 4. converttoascii?boolean flag that tells the function whether the string needs to be converted to ascii before it is returned to the caller. the fl ag is set to true by default (i.e., the caller is expecting the string in ascii format). return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.23. cp210x_getdevicevid description: returns the 2-byte vendor id field of th e device descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getdevicevid( handle handle, lpword vid ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. vid?pointer to a 2-byte value that retu rns the vendor id of the cp210x device. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 rev. 2.0 23 5.24. cp210x_getdevicepid description: returns the 2-byte product id field of the device descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getdevicepid( handle handle, lpword pid ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. pid?pointer to a 2-byte value that retu rns the product id of the cp210x device. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.25. cp210x_getselfpower description: returns the state of the self-powered bit of the po wer attributes field of the configuration descrip - tor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getselfpower( handle handle, lpbool selfpower ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. selfpower?pointer to a boolean flag where true means the self-powered bit is set, and false means the self-powered bit is cleared. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 24 rev. 2.0 5.26. cp210x_getmaxpower description: returns the 1-byte max power field of the configuration descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getmaxpower( handle handle, lpbyte maxpower ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. maxpower?pointer to a 1-byte value return ing the maximum power consumption of the cp210x usb device expressed in 2 ma units. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.27. cp210x_getmaxpower description: returns the 1-byte max power field of the configuration descriptor of a cp210x device. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getmaxpower( handle handle, lpbyte maxpower ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. maxpower?pointer to a 1-byte value return ing the maximum power consumption of the cp210x usb device expressed in 2 ma units. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 rev. 2.0 25 5.28. cp210x_getflushbufferconfig description: returns the flush buffer configuration of a cp210x device. supported devices: cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getflushbufferconfig( handle handle, ? lpword flushbufferconfig ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. flushbufferconfig?pointer to t he values which indicates which buffer(s) are flushed (tx and/ or rx) and upon which event (open and/or close). see the header file for the bit defintions for this byte value. return value: cp210x_status = cp210x_success, ? cp210x_device_not_found, ? cp210x_invalid_handle, ? cp210x_function_not_supported 5.29. cp210x_getdevicemode description: gets the operating mode (gpio or modem) or each interface of a cp210x device. supported devices: cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setmaxpower( handle handle, ? byte devicemodeeci, byte devicemodesci) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . 2. devicemodeeci?pointer to a 1-byte value returning the 0 if interface is in modem mode, or 1 if gpio mode. 3. devicemodesci?pointer to a 1-byte value returning the 0 if interface is in modem mode, or 1 if gpio mode. return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_not_found ? cp210x_function_not_supported ?
AN144 26 rev. 2.0 5.30. cp210x_getbaudrateconfig description: returns the baud rate configuration data of a cp210x device. supported devices: cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status winapi cp210x_getbaudrateconfig(handle cyhandle, baud_config* baudconfigdata); parameters: 1. handle?handle to the device on which to determine the lock value. 2. baudconfigdata?pointer to a baud_config structure returning the baud config data of the device. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed 5.31. cp210x_getlockvalue description: returns the 1-byte lock value of a cp210x device. supported devices: cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status winapi cp210x_getlockvalue(handle cyhandle, ? lpbyte lpblockvalue); parameters: 1. handle?handle to the device on which to determine the lock value. 2. lockvalue?pointer to a 1-byte value returning the lock value of the device. a 0x01 denotes that the device is locked, and a 0x00 denotes that the device is unlocked. return value: cp210x_status = cp210x_success, ? cp210x_invalid_parameter, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 rev. 2.0 27 5.32. cp210x_getportconfig description: gets the current port pin configuration from the cp210x device. supported devices: cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_getportconfig(handle handle, lpvoid portconfig) parameters: 1. handle?handle to the device as returned by cp210x_open() 2. port config?pointer to a port_config structure return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed, ? cp210x_unsupported_device 5.33. cp210xgetdualportconfig description: gets the current port pin configuration from the cp210x device. supported devices: cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_setportconfig(handle handle, lpvoid dualportcon- fig) parameters: 1. handle?handle to the device as returned by cp210x_open() 2. dualportconfig?pointer to a dual_port_config structure return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed, ? cp210x_unsupported_device 5.34. cp210x_reset description: initiates a reset of the usb interface. note: there is a delay of ~1 second before the reset is initiated by the device firmware to give the application time to call cp210x_close() to close the device handle. no further operations should be perform ed with the device until it resets, re- enumerates in windows, and a new handle is opened. supported devices: cp2101, cp2102, cp2103, cp2104, cp2105 location: cp210x manufacturing dll prototype: cp210x_status cp210x_reset( handle handle ) parameters: 1. handle?handle to the device to close as returned by cp210x_open() . return value: cp210x_status = cp210x_success, ? cp210x_invalid_handle, ? cp210x_device_io_failed
AN144 28 rev. 2.0 d ocument c hange l ist revision 1.4 to revision 1.5 ? updated text in "1. introduction" on page 1 . ? updated text in "3. customizing driv er installations, cp210x custom setup utilit y (cp2101/2/3/4/5)" on page 1 . ? sections 3.1 through 3.7 removed. ? ?customizing driver installations, macintosh os9 and osx? removed. ? cp210x.dll changed to cp210xmanufacturing.dll ? cp210x.lib changed to cp210xmanufacturing.lib ? cp210x.h changed to cp210xmanufacturingdll.h revision 1.5 to revision 1.6 ? added cp2103 to relevant devices on page 1. ? "4.4. building cp210xsetids.exe, cp2110setids.exe, or cp2112setids.exe" on page 8 . ?? updated title ? added "5.32. cp210x_getportconfig" on page 27 . ? added "5.18. cp210xsetportconfig" on page 19 . ? " appendix?type definitions and constants" on page 23. ?? updated code. revision 1.6 to revision 1.7 ? corrected typo in the warning in section "5.17. cp210x_setlockvalue" on page 18 . ? correct pdf bookmarks. revision 1.7 to revision 1.8 ? added support for cp2104, cp2105. revision 1.8 to revision 1.9 ? added support for cp2110 and cp2112. revision 1.9 to revision 2.0 ? added function definitions for new cp2104/cp2105- related functions in manufacturing dll. ? removed appendix.
AN144 rev. 2.0 29 n otes :
AN144 30 rev. 2.0 c ontact i nformation silicon laboratories inc. ? 400 west cesar chavez ? austin, tx 78701 ? tel: 1+(512) 416-8500 ? fax: 1+(512) 416-9669 ? toll free: 1+(877) 444-3032 please visit the silicon labs technical support web page: ? https://www.silabs.com/support/pages/contacttechnicalsupport.aspx ? and register to submit a technical support request. silicon laboratories and silicon labs are trademarks of silicon laboratories inc. other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders. the information in this document is believed to be accurate in all respects at the time of publ ication but is subject to change without notice. silicon laboratories assumes no responsibility for errors and om issions, and disclaims responsibi lity for any consequences resu lting from the use of information included herein. ad ditionally, silicon laboratorie s assumes no responsibility for the functioning of und escribed features or parameters. silicon laboratories reserves the right to make changes without further notice . silicon laboratories makes no wa rranty, rep- resentation or guarantee regarding the suitability of its products for any particular purpose, nor does silicon laboratories as sume any liability arising out of the application or use of any product or circuit, and s pecifically disclaims any and all liability, including wi thout limitation conse- quential or incidental damages. silicon laborat ories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of t he silicon laboratories product could create a s ituation where per- sonal injury or death may occur. should buyer purchase or us e silicon laboratories products for any such unintended or unauthor ized ap- plication, buyer shall indemnify and hold silicon laboratories harmles s against all claims and damages.


▲Up To Search▲   

 
Price & Availability of AN144

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X